import 'dart:io';

import 'package:cached_network_image/cached_network_image.dart';
import 'package:hongsheng/api/SPClassNetConfig.dart';
import 'package:hongsheng/app/SPClassApplicaion.dart';
import 'package:hongsheng/utils/SPClassCommonMethods.dart';
import 'package:hongsheng/utils/SPClassImageUtil.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SPClassSplashPage extends StatefulWidget {
  VoidCallback callback;

  SPClassSplashPage(this.callback);
  SPClassSplashPageState createState() => SPClassSplashPageState();
}

class SPClassSplashPageState extends State<SPClassSplashPage> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    // ScreenUtil.init(BoxConstraints(
    //     maxWidth: MediaQuery.of(context).size.width,
    //     maxHeight: MediaQuery.of(context).size.height),
    //     context: context, designSize: Size(360, 640));
    //return Image.asset(SPClassImageUtil.spFunGetImagePath('ic_start'),width: MediaQuery.of(context).size.width,);
    return Image.network("http://cdn.gz583.com/img/startup.png",width: MediaQuery.of(context).size.width);
    // return Container(
    //   color: Colors.white,
    //   width: MediaQuery.of(context).size.width,
    //   height: MediaQuery.of(context).size.height,
    //   child: CachedNetworkImage(
    //     fit: BoxFit.cover,
    //     width: MediaQuery.of(context).size.width,
    //     imageUrl:
    //     "${SPClassNetConfig.spFunGetImageUrl()}img/startup.png?time=${DateTime.now().millisecondsSinceEpoch.toString()}",
    //     imageBuilder: (context, imageProvider) => Container(
    //       decoration: BoxDecoration(
    //         image: DecorationImage(
    //           image: imageProvider,
    //           fit: BoxFit.cover,
    //         ),
    //       ),
    //     ),
    //     errorWidget: (context, url, error) =>
    //         Image.asset(
    //           SPClassImageUtil.spFunGetImagePath("bg_splash"),
    //           fit: BoxFit.cover,
    //           width: MediaQuery.of(context).size.width,
    //         ),
    //   ),
    // );
  }
}
